insert in the correct place instead of naïvely appending.
authorJonathan Blandford <jrb@gnome.org>
Fri, 5 Mar 2004 06:51:22 +0000 (06:51 +0000)
committerJonathan Blandford <jrb@src.gnome.org>
Fri, 5 Mar 2004 06:51:22 +0000 (06:51 +0000)
Fri Mar  5 01:45:04 2004  Jonathan Blandford  <jrb@gnome.org>

        * gtk/gtkfilechooserdefault.c (shortcuts_append_paths): insert in
        the correct place instead of naïvely appending.
        (shortcuts_add_volumes): refilter the model
        (shortcuts_add_bookmarks): refilter the model
        (gtk_file_chooser_default_add_shortcut_folder): refilter the model

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtkfilechooserdefault.c

index c7a754c7c8ba7236f571cb062c142cea1d986bcf..c34388f68ef568e79b9754292456c960e00cb410 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+Fri Mar  5 01:45:04 2004  Jonathan Blandford  <jrb@gnome.org>
+
+       * gtk/gtkfilechooserdefault.c (shortcuts_append_paths): insert in
+       the correct place instead of naïvely appending.
+       (shortcuts_add_volumes): refilter the model
+       (shortcuts_add_bookmarks): refilter the model
+       (gtk_file_chooser_default_add_shortcut_folder): refilter the model
+
 2004-03-04  Federico Mena Quintero  <federico@ximian.com>
 
        * gtk/gtkfilechooserdialog.c (response_cb):  New handler.  Ask the
index c7a754c7c8ba7236f571cb062c142cea1d986bcf..c34388f68ef568e79b9754292456c960e00cb410 100644 (file)
@@ -1,3 +1,11 @@
+Fri Mar  5 01:45:04 2004  Jonathan Blandford  <jrb@gnome.org>
+
+       * gtk/gtkfilechooserdefault.c (shortcuts_append_paths): insert in
+       the correct place instead of naïvely appending.
+       (shortcuts_add_volumes): refilter the model
+       (shortcuts_add_bookmarks): refilter the model
+       (gtk_file_chooser_default_add_shortcut_folder): refilter the model
+
 2004-03-04  Federico Mena Quintero  <federico@ximian.com>
 
        * gtk/gtkfilechooserdialog.c (response_cb):  New handler.  Ask the
index c7a754c7c8ba7236f571cb062c142cea1d986bcf..c34388f68ef568e79b9754292456c960e00cb410 100644 (file)
@@ -1,3 +1,11 @@
+Fri Mar  5 01:45:04 2004  Jonathan Blandford  <jrb@gnome.org>
+
+       * gtk/gtkfilechooserdefault.c (shortcuts_append_paths): insert in
+       the correct place instead of naïvely appending.
+       (shortcuts_add_volumes): refilter the model
+       (shortcuts_add_bookmarks): refilter the model
+       (gtk_file_chooser_default_add_shortcut_folder): refilter the model
+
 2004-03-04  Federico Mena Quintero  <federico@ximian.com>
 
        * gtk/gtkfilechooserdialog.c (response_cb):  New handler.  Ask the
index c7a754c7c8ba7236f571cb062c142cea1d986bcf..c34388f68ef568e79b9754292456c960e00cb410 100644 (file)
@@ -1,3 +1,11 @@
+Fri Mar  5 01:45:04 2004  Jonathan Blandford  <jrb@gnome.org>
+
+       * gtk/gtkfilechooserdefault.c (shortcuts_append_paths): insert in
+       the correct place instead of naïvely appending.
+       (shortcuts_add_volumes): refilter the model
+       (shortcuts_add_bookmarks): refilter the model
+       (gtk_file_chooser_default_add_shortcut_folder): refilter the model
+
 2004-03-04  Federico Mena Quintero  <federico@ximian.com>
 
        * gtk/gtkfilechooserdialog.c (response_cb):  New handler.  Ask the
index c7a754c7c8ba7236f571cb062c142cea1d986bcf..c34388f68ef568e79b9754292456c960e00cb410 100644 (file)
@@ -1,3 +1,11 @@
+Fri Mar  5 01:45:04 2004  Jonathan Blandford  <jrb@gnome.org>
+
+       * gtk/gtkfilechooserdefault.c (shortcuts_append_paths): insert in
+       the correct place instead of naïvely appending.
+       (shortcuts_add_volumes): refilter the model
+       (shortcuts_add_bookmarks): refilter the model
+       (gtk_file_chooser_default_add_shortcut_folder): refilter the model
+
 2004-03-04  Federico Mena Quintero  <federico@ximian.com>
 
        * gtk/gtkfilechooserdialog.c (response_cb):  New handler.  Ask the
index c5188a47ad7fb3e324bd06371e89b1f507431b7d..1692c2d093ba4e05637c2e7f711c0a273d12f0e6 100644 (file)
@@ -852,8 +852,12 @@ static int
 shortcuts_append_paths (GtkFileChooserDefault *impl,
                        GSList                *paths)
 {
+  int start_row;
   int num_inserted;
 
+  /* As there is no separator now, we want to start there.
+   */
+  start_row = shortcuts_get_index (impl, SHORTCUTS_BOOKMARKS_SEPARATOR);
   num_inserted = 0;
 
   for (; paths; paths = paths->next)
@@ -865,8 +869,7 @@ shortcuts_append_paths (GtkFileChooserDefault *impl,
       error = NULL;
 
       /* NULL GError, but we don't really want to show error boxes here */
-
-      if (shortcuts_insert_path (impl, -1, FALSE, NULL, path, NULL, TRUE, NULL))
+      if (shortcuts_insert_path (impl, start_row + num_inserted, FALSE, NULL, path, NULL, TRUE, NULL))
        num_inserted++;
     }
 
@@ -992,14 +995,15 @@ shortcuts_add_volumes (GtkFileChooserDefault *impl)
       GtkFileSystemVolume *volume;
 
       volume = l->data;
-
       shortcuts_insert_path (impl, start_row + n, TRUE, volume, NULL, NULL, FALSE, NULL);
       n++;
     }
 
   impl->num_volumes = n;
-
   g_slist_free (list);
+
+  if (impl->shortcuts_filter_model)
+    gtk_tree_model_filter_refilter (GTK_TREE_MODEL_FILTER (impl->shortcuts_filter_model));
 }
 
 /* Used from shortcuts_remove_rows() */
@@ -1054,6 +1058,8 @@ shortcuts_add_bookmarks (GtkFileChooserDefault *impl)
     {
       shortcuts_insert_separator (impl, SHORTCUTS_BOOKMARKS_SEPARATOR);
     }
+  if (impl->shortcuts_filter_model)
+    gtk_tree_model_filter_refilter (GTK_TREE_MODEL_FILTER (impl->shortcuts_filter_model));
 }
 
 /* Appends a separator and a row to the shortcuts list for the current folder */
@@ -3290,6 +3296,9 @@ gtk_file_chooser_default_add_shortcut_folder (GtkFileChooser    *chooser,
   if (result)
     impl->num_shortcuts++;
 
+  if (impl->shortcuts_filter_model)
+    gtk_tree_model_filter_refilter (GTK_TREE_MODEL_FILTER (impl->shortcuts_filter_model));
+
   return result;
 }